﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Cofe.Core.Property;

namespace Cofe.Core.Tasks
{
    /// <summary>
    /// Used by property provider to construct task, task are created but not running.
    /// PropertyInvoker will that start them with the supplied TaskFactory.
    /// </summary>
    public interface ITaskConstructor 
    {
        Task CreateTask(IPropertyHost propertyHost, object property, Action<object> action, CancellationToken cancelToken);        
        Task<T> CreateTask<T>(IPropertyHost propertyHost, object property, Func<object, T> func, CancellationToken cancelToken);        
        Task CreateTask(IPropertyHost propertyHost, object property, Action<object> action);        
        Task<T> CreateTask<T>(IPropertyHost propertyHost, object property, Func<object, T> func);
    }
}
